import Vue from 'vue'
import VueRouter from "vue-router"
import Layout from '@/layout/index'

Vue.use(VueRouter)


const constantRoutes =[
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/login')
    },
    {
        path: '/',
        component: Layout,
        redirect: '/appmain',
        children: [
            {
                path: '/appmain',
                component: () => import('@/views/appmain/index'),
            },
            {
                path: '/blog',
                component: () => import('@/views/blog/BlogList')
            },
            {
                path: '/user',
                component: () => import('@/views/user')
            },
        ]
    }

]

const router = new VueRouter({
    mode: 'history',
    routes: constantRoutes
})

export default router
